package com.honglang.module.article.dao;

import java.util.List;

import com.honglang.dao.GenericDaoImpl;
import com.honglang.module.article.entity.KeyWord;

public class KeyWordDaoImpl  extends GenericDaoImpl<KeyWord,Integer> implements KeyWordDao{
	
	
	/**
	 * Get the KeyWord Entity by it's name
	 * @param keyWord
	 * @return
	 */
	public KeyWord getKeyWordByName(String keyWord){
		KeyWord keyWordExample = new KeyWord();
		keyWordExample.setName(keyWord);
		List<KeyWord> keyWordList = this.getByExample(keyWordExample);
		return keyWordList.size() > 0 ? keyWordList.get(0):null;
	}
}
